package com.zhiyou100.review.day019.homework;

import java.util.Arrays;

/**
 * @packageName: Homework6
 * @className: com.zhiyou100.review.day019.homework
 * @Description: TODO 作业6 打印数组 如数组是：[3,6,9,1,5]
 * @author: yang
 * @date: 6/30/20
 */
public class Homework6 {
    public static void main(String[] args) {
        int[] ints = {3, 6, 9, 1, 5};
        new Homework6().printOne(ints);
    }

    private void printOne(int[] args) {
        int[] clone = args.clone();
        Arrays.sort(clone);
        int max = clone[clone.length - 1];
        // 获取最大值

        for (int j = 1; j <= max; j++) {
            for (int arg : args) {
                if (j <= max - arg) {
                    System.out.print(" ");
                } else {
                    System.out.print("*");
                }
            }
            System.out.println();

        }

    }
}
